﻿using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;

namespace ERP_RORZE_PRODUCT.Product.Incauhinh
{
    public partial class Rp_InLenh : DevExpress.XtraReports.UI.XtraReport
    {
        //public string sokehoach;
        //public string orderPKD;
        //public string sLCan;
        //public string SLLenh;
        //public string ThanLenh;
        //public string KichThuocPhoi;
        //public string LoaiPhoi;
        //public string CoCat;
        //public string GcongTho;

        //public string PartID;
        //public string Mono;

        //public string ThoiHanGcong;
        //public string LongRen;
        //public string PhunCat;
        //public string NgayIn;
        //public string ChuY;
        //public string Solenhnhapkho;
        private DataTable parent;

        public Rp_InLenh(ObjectInLenh obLenh)
        {
            InitializeComponent();
            this.parent = obLenh.OptionData;

            lblTopLeft.Text = obLenh.TopLeft;
            lbSokehoach.Text = obLenh.Sokehoach;
            lbOrderPKD.Text = obLenh.OrderPkd;
            lbSLCan.Text = obLenh.SLCan;
            lbSLLenh.Text = obLenh.SlLenh;
            lbThanLenh.Text = obLenh.ThanLenh;
            lbKichThuocPhoi.Text = obLenh.KichThuocPhoi;
            lbLoaiPhoi.Text = obLenh.LoaiPhoi;
            lbCoCat.Text = obLenh.CoCat;
            lbGcongTho.Text = obLenh.GcongTho;

            lbPartID.Text = obLenh.PartId;
            lbMono.Text = obLenh.Mono;

            lbThoiHanGcong.Text = obLenh.ThoiHanGcong;
            lbLongRen.Text = obLenh.LongRen;
            lbPhunCat.Text = obLenh.PhunCat;
            lblNgayIn.Text = obLenh.NgayIn;
            lblChuY.Text = obLenh.ChuY;
            lblSolenhnhapkho.Text = obLenh.Solenhnhapkho;
            this.DataSource = obLenh.OptionData;
        }

        private void xrTableCell42_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            foreach (DataRow dataRow in this.parent.Rows)
            {
                if (dataRow["Jig"].ToString() == "True")
                {
                    xrTableCell42.Text = "Yes";
                }
                else
                {
                    xrTableCell42.Text = "No";

                }
            }
        }

    }
}
